#include <QApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include "./sql/mysqlserver.h"
#include "./serial/serialportmanager.h"

int main(int argc, char *argv[]){
    QApplication app(argc, argv);

    MysqlServer server;
//    SerialPortManager serialportmanager;

//    server.pushDatas("12","5","tube_out","960","2018-09-20 06:20:23");

    QQmlApplicationEngine engine;
    qmlRegisterType<SerialPortManager>("SerialPortManager",1,0,"SerialPortManager");
    engine.rootContext()->setContextProperty("server",&server);
//    engine.rootContext()->setContextProperty("serialPortManager",&serialportmanager);
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    return app.exec();
}

